import request from '@/utils/request'

//公告分类列表
export function articleCategoryList() {
  return request({
    url: '/admin/article/category/list',
    method: 'get'
  })
}

//公告分类添加、编辑
export function articleCategorySave(data) {
  return request({
    url: '/admin/article/category/save',
    method: 'post',
    data
  })
}

//删除公告分类
export function articleCategoryDelete(data) {
  return request({
    url: '/admin/article/category/del',
    method: 'delete',
    data
  })
}


//公告列表
export function articleList(params) {
  return request({
    url: '/admin/article/list',
    method: 'get',
    params: params,
    // headers: {
    //   'Content-Type': 'application/json;charset=utf-8'
    // }
  })
}

//公告添加、编辑
export function articleAdd(data) {
  return request({
    url: '/admin/article/edit',
    method: 'post',
    data
  })
}


//删除公告
export function articleDelete(params) {
  return request({
    url: '/admin/article/del',
    method: 'delete',
    params
  })
}

//公告详情
export function articleDetail(id) {
  return request({
    url: '/admin/article/detail/' + id,
    method: 'get'
  })
}
